package com.lamda.zhekou.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by MJiao on 11/22/14.
 */
@Component
public class ApplicationSettings {

    @Value("${server.port}")
    private int serverPort;
    @Value("${master.port}")
    private int masterSeverPort;

    @Value("${spring.datasource.url}")
    private String jdbcUrl;

    @Value("${spring.datasource.username}")
    private String jdbcUsername;

    @Value("${spring.datasource.password}")
    private String jdbcPassword;

    @Value("${spring.jpa.hibernate.ddl-auto}")
    private String ddlAuto;

    @Value("${spring.jpa.hibernate.show_sql}")
    private String showSql;

    @Value("${spring.jpa.hibernate.format_sql}")
    private String formatSql;

    @Value("${spring.jpa.hibernate.dialect}")
    private String hibernateDialect;




    public int getServerPort() {
        return serverPort;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public String getJdbcUsername() {
        return jdbcUsername;
    }

    public String getJdbcPassword() {
        return jdbcPassword;
    }

    public String getDdlAuto() {
        return ddlAuto;
    }

    public String getShowSql() {
        return showSql;
    }

    public String getFormatSql() {
        return formatSql;
    }

    public String getHibernateDialect() {
        return hibernateDialect;
    }

    public void setServerPort(int serverPort) {
        this.serverPort = serverPort;
    }

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    public void setJdbcUsername(String jdbcUsername) {
        this.jdbcUsername = jdbcUsername;
    }

    public void setJdbcPassword(String jdbcPassword) {
        this.jdbcPassword = jdbcPassword;
    }

    public void setDdlAuto(String ddlAuto) {
        this.ddlAuto = ddlAuto;
    }

    public void setShowSql(String showSql) {
        this.showSql = showSql;
    }

    public void setFormatSql(String formatSql) {
        this.formatSql = formatSql;
    }

    public void setHibernateDialect(String hibernateDialect) {
        this.hibernateDialect = hibernateDialect;
    }

    public int getMasterSeverPort() {
        return masterSeverPort;
    }

    public void setMasterSeverPort(int masterSeverPort) {
        this.masterSeverPort = masterSeverPort;
    }

    @Override
    public String toString() {
        return "ApplicationSettings{" +
                "serverPort=" + serverPort +
                ", masterSeverPort=" + masterSeverPort +
                ", jdbcUrl='" + jdbcUrl + '\'' +
                ", jdbcUsername='" + jdbcUsername + '\'' +
                ", jdbcPassword='" + jdbcPassword + '\'' +
                ", ddlAuto='" + ddlAuto + '\'' +
                ", showSql='" + showSql + '\'' +
                ", formatSql='" + formatSql + '\'' +
                ", hibernateDialect='" + hibernateDialect + '\'' +
                '}';
    }
}
